<?php
// 应用公共文件
use extend\VarDumper;

/**
 * 调试方法
 *
 * @param      $var
 * @param bool $isEnd
 * @param bool $highlight
 */
function t_debug($var, $isEnd = true, $highlight = true)
{
    $trace = debug_backtrace();
    $echo  = "<pre>file:{$trace[0]['file']}\n<br>line:{$trace[0]['line']}\n<br><hr>output:\n<br>";
    echo $echo;
    if ($highlight) {
        $dump = new VarDumper();
        echo $dump->dumpAsString($var, 10, $highlight);
    } else {
        var_dump($var);
    }
    $isEnd && exit();
}
